package sv.gob.mh.dgii.model;

// Generated Dec 12, 2007 1:25:05 PM by Hibernate Tools 3.2.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CgOrigenExp generated by hbm2java
 */
@Entity
@Table(name = "CG_ORIGEN_EXP", schema = "UPET")
public class CgOrigenExp implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7809090333386670860L;
	private String corigen;
	private String dorigen;
	private String cusuario;
	private Date fhingreso;
	private Date fhmodificacion;
	private Set<CgCaso> cgCasos = new HashSet<CgCaso>(0);

	public CgOrigenExp() {
	}

	public CgOrigenExp(String corigen, String dorigen, String cusuario,
			Date fhingreso, Date fhmodificacion) {
		this.corigen = corigen;
		this.dorigen = dorigen;
		this.cusuario = cusuario;
		this.fhingreso = fhingreso;
		this.fhmodificacion = fhmodificacion;
	}

	public CgOrigenExp(String corigen, String dorigen, String cusuario,
			Date fhingreso, Date fhmodificacion, Set<CgCaso> cgCasos) {
		this.corigen = corigen;
		this.dorigen = dorigen;
		this.cusuario = cusuario;
		this.fhingreso = fhingreso;
		this.fhmodificacion = fhmodificacion;
		this.cgCasos = cgCasos;
	}

	@Id
	@Column(name = "C_ORIGEN", unique = true, nullable = false, length = 2)
	public String getCorigen() {
		return this.corigen;
	}

	public void setCorigen(String corigen) {
		this.corigen = corigen;
	}

	@Column(name = "D_ORIGEN", nullable = false, length = 40)
	public String getDorigen() {
		return this.dorigen;
	}

	public void setDorigen(String dorigen) {
		this.dorigen = dorigen;
	}

	@Column(name = "C_USUARIO", nullable = false, length = 30)
	public String getCusuario() {
		return this.cusuario;
	}

	public void setCusuario(String cusuario) {
		this.cusuario = cusuario;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_INGRESO", nullable = false, length = 7)
	public Date getFhingreso() {
		return this.fhingreso;
	}

	public void setFhingreso(Date fhingreso) {
		this.fhingreso = fhingreso;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_MODIFICACION", nullable = false, length = 7)
	public Date getFhmodificacion() {
		return this.fhmodificacion;
	}

	public void setFhmodificacion(Date fhmodificacion) {
		this.fhmodificacion = fhmodificacion;
	}

	@OneToMany(cascade = {CascadeType.PERSIST}, fetch = FetchType.LAZY, mappedBy = "cgOrigenExp")
	public Set<CgCaso> getCgCasos() {
		return this.cgCasos;
	}

	public void setCgCasos(Set<CgCaso> cgCasos) {
		this.cgCasos = cgCasos;
	}

}
